const conn = require('mysql2/promise').createConnection({ //创建单个连接
    user: 'mydb',
    password: 'mydb',
    database: 'testmydb'
}).then(conn => {
    const res = conn.query('select * from `bookinfo`')
    return res;
}).then(([rows, fields]) => {
    console.log(rows);
})